import { Component } from 'react';
import axios from 'axios'
// 操作props
const withInputWrapper = (WrapperComponent:any) => {
  return class extends  Component {
    state = {
      list: {}
    }
    async componentDidMount() {
      const data = await axios.get('/data.json')
      console.log('data:', data)
      this.setState({list: data})
    }
    render() {
      return <WrapperComponent {...this.state} {...this.props} />
    }
  }
}

export default withInputWrapper;
